package middle

import (
	"github.com/gin-gonic/gin"
	"liao/pkg"
)

func ParseToken(c *gin.Context) {
	token := c.GetHeader("token")
	handler, err := pkg.TokenHandler(token)
	if err != nil {
		return
	}
	c.Set("handler", handler)
	c.Next()
}
